{% extends 'stark/../layout.html' %}
{% load stark %}

{% block css %}
    <style>
        .comb-search {
            padding: 5px 20px;
        }

        .comb-search .row .whole {
            width: 60px;
            float: left;

        }

        .comb-search .row .others {
            padding-left: 60px;
        }

        .comb-search .row a {
            display: inline-block;
            padding: 5px 8px;
            margin: 3px;
            border: 1px solid #d4d4d4;

        }

        .comb-search .row a {
            display: inline-block;
            padding: 5px 8px;
            margin: 3px;
            border: 1px solid #d4d4d4;
        }

        .comb-search a.active {
            color: #fff;
            background-color: #337ab7;
            border-color: #2e6da4;
        }
    </style>
{% endblock %}

{% block content %}
    <div class="comb-search">
        {% for row in cl.gen_list_filter_rows %}
            <div class="row">
                {#                <div class="whole">#}
                {#                    <a href="">全部</a>#}
                {#                </div>#}
                {#                <div class="others">#}
                {#                    {% for item in row %}#}
                {#                        <a href="">{{ item }}</a>#}
                {#                    {% endfor %}#}
                {#                </div>#}
                {% for item in row %}
                    {{ item|safe }}
                {% endfor %}
            </div>
        {% endfor %}
    </div>


    <div style="margin: 10px">
        {% if cl.add_btn %}
            <div style="margin: 10px 0">
                {{ cl.add_btn }}
            </div>
        {% endif %}

        <div>
            {% if cl.search_list %}
                <form action="" method="get" class="form-inline" style="float: right">
                    <div class="form-group">
                        <input type="text" name="q" value="{{ cl.q }}" placeholder="关键字搜索" class="form-control">
                        <input type="submit" value="搜索" class="btn btn-primary">
                    </div>
                </form>
            {% endif %}
        </div>

        <form class="form-inline" method="post">
            {% csrf_token %}
            {% if cl.action_list %}
                <div class="form-group">
                    <select name="action" class="form-control">
                        <option value="">请选择功能</option>
                        {% for item in cl.action_list %}
                            <option value="{{ item.name }}">{{ item.text }}</option>
                        {% endfor %}
                    </select>
                    <input type="submit" class="btn btn-primary" value="执行">
                </div>
            {% endif %}

            {#        <table class="table table-bordered" style="margin-top: 10px">#}
            {#            <thead>#}
            {#            <tr>#}
            {#                {% for item in head_list %}#}
            {#                    <th>{{ item }}</th>#}
            {#                {% endfor %}#}
            {#            </tr>#}
            {#            </thead>#}
            {#            <tbody>#}
            {#            {% for row in body_list %}#}
            {#                <tr>#}
            {#                    {% for item in row %}#}
            {#                        <td>{{ item }}</td>#}
            {#                    {% endfor %}#}
            {#                </tr>#}
            {#            {% endfor %}#}
            {#            </tbody>#}
            {#        </table>#}
            {% table cl %}
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    {{ cl.page.page_html|safe }}
                </ul>
            </nav>
        </form>
    </div>
{% endblock %}